    <?php 
        include '../header.php'; 
        
        if(!isset($_POST['uid'])) {
            $_POST['uid'] = $_GET['uid'];
        }
        if ($_SESSION['uid']==$_POST['uid']) { header("Location:miPerfil.php"); }
    ?>
    <title>Kinet | Perfil de <?php echo $datos['nombre']; ?></title>
    <link rel="stylesheet" href="../fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
    <script type="text/javascript" src="../fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
    <script type="text/javascript" src="../fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
    <link href='http://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
    
</head>
<body>
        <?php include '../menus/menuUsuario.php'; ?>
        <div id="principal">
        <?php
            
            if ($_POST['uid'] == $_SESSION['uid']) {
                header ('Location:miPerfil.php');
            }

            //obtenemos los datos del usuario del que queremos ver el perfil
            $datos = datosUsuario($_POST['uid']);
            
            //ponemos el include después de la recogida de datos, porque necesitamos el nombre
            //del usuario para ponerlo en la pestaña
            include 'pestanasPerfil.php';
        ?>
        <style>
            .tarjeta {
                float: none;
                height:auto;
                margin:0 auto;
                min-height:250px;
                width:930px;
                padding:10px;
                /*border:silver solid 1px;*/
                /*background-color:whitesmoke;*/
                margin-top:20px;
                position:relative;
            }
            
            /**************************VALORACIÓN USUARIO****************************/
            .rating {
                float:left;
                font-size:15px;
            }

            @font-face { font-family: "kinet"; src: url("../fonts/kinet.ttf") format ("ttf"); }

            /* :not(:checked) is a filter, so that browsers that don’t support :checked don’t 
               follow these rules. Every browser that supports :checked also supports :not(), so
               it doesn’t make the test unnecessarily selective */
            .rating:not(:checked) > input {
                position:absolute;
                top:-9999px;
                clip:rect(0,0,0,0);
            }

            .rating:not(:checked) > label {
                float:right;
                width:37px;
                padding:0 .1em;
                overflow:hidden;
                white-space:nowrap;
                cursor:pointer;
                font-size:200%;
                line-height:1.2;
                color:#ddd;
                /*text-shadow:1px 1px #bbb, 2px 2px #666, .1em .1em .2em rgba(0,0,0,.5);*/
            }

            .rating:not(:checked) > label:before {
                /*font-family: "kinet";*/
                /*content: 'a';*/
                content: '★ ';
            }

            .rating > input:checked ~ label {
                color: #f70;
                /*text-shadow:1px 1px #c60, 2px 2px #940, .1em .1em .2em rgba(0,0,0,.5);*/
            }

            .rating:not(:checked) > label:hover,
            .rating:not(:checked) > label:hover ~ label {
                color: gold;
                /*text-shadow:1px 1px goldenrod, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);*/
            }

            .rating > input:checked + label:hover,
            .rating > input:checked + label:hover ~ label,
            .rating > input:checked ~ label:hover,
            .rating > input:checked ~ label:hover ~ label,
            .rating > label:hover ~ input:checked ~ label {
                color: #ea0;
                /*text-shadow:1px 1px goldenrod, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);*/
            }

            .rating > label:active {
                position:relative;
                top:2px;
                left:2px;
            }
        </style>
        
        <!--<div class='tarjeta'>-->
            <?php
                include 'foto.php';
                include 'infoBasica.php';
                include 'social.php';
                include 'roles.php';
            ?>
            <div class="denunciar abajo derecha" id="denunciarUsuario" data-toggle="modal" data-target="#formularioDenuncia">
                <i class="glyphicon glyphicon-flag"></i>
            </div>
            <script>
                $(document).ready(function(){
                    $("#denunciarUsuario").tooltip({ placement: 'left', html : true, trigger:'hover', title: 'Denunciar a <?php echo $nombreUsuario?>'});
                });
            </script>
            <div style='clear:both'></div>
        <!--</div>-->
                
            <!--************************BOTONES***********************-->
            <style>
                .plano {
                    /*background-color:blue !important;*/
                    border-radius: 0;
                    width:150px;
                }
                
                .contenedorBotones {
                    float:left;
                    width:100%;
                    text-align:center;
                    height:30px;
                    margin:20px 0 20px 0;
                }
            </style>            
            
            <div class='contenedorBotones'>
                    <?php if ($datos['videobook'] != "") {  ?>
                        <a id="videobook" class="btn btn-info plano" href="<?php echo $datos['videobook'] ?>"><i class='glyphicon glyphicon-film'>&nbsp;</i>Videobook</a>
                    <?php } ?>
                    <?php if (sonContacto($_SESSION['uid'], $_POST['uid'])){ ?>
                        <button class="btn btn-info plano" data-toggle="modal" data-target="#valorar"><i class="glyphicon glyphicon-star"></i>&nbsp;Valorar</button>
                    <?php } else { ?>
                        <button class="btn btn-info plano disabled" >Valorar</button>
                    <?php } ?>
                        <button class="btn btn-info plano" data-toggle="modal" data-target="#enviarMensaje"><i class="glyphicon glyphicon-envelope"></i>&nbsp;Mensaje</button>
                    <?php if (!sonContacto($_SESSION['uid'], $_POST['uid'])) {?>
                        <?php if (!contactoSolicitado($_SESSION['uid'], $_POST['uid'])) { ?>
                            <button class="btn btn-info plano" title="Solicitar añadir a mis contactos" onClick="javascript:document.contacto.submit();"><i class="glyphicon glyphicon-link"></i>&nbsp;Contacto</button>
                        <?php } else { ?>
                            <button class="btn btn-info plano disabled" title="Solicitar añadir a mis contactos"><i class="glyphicon glyphicon-link"></i>&nbsp;Solicitado</button>
                        <?php } ?>
                    <?php } ?>
                        
                    <div style="float:left;width:0px;height:0px;">
                        <?php if (sonContacto($_SESSION['uid'], $uid)){ ?>
                                <form name="valorar" action="valorarUsuario.php" method="post">
                                    <input name="uid" type="hidden" value="<?php echo $_POST['uid'] ?>">
                                    <input name="nombreUsuario" type="hidden" value="<?php echo $nombreUsuario ?>">
                                </form>
                         <?php } ?>
<!--                            <form name="mensaje" method="post" action="../mensajes/enviarMensaje.php">
                                <input type="hidden" name="nombreUsuario" value="<?php // echo $nombreUsuario ?>">
                                <input type="hidden" name="uid" value="<?php // echo $_POST['uid']; ?>">
                            </form>-->
                            <form name="contacto" method="post" action="../logic/solicitarContacto.php">
                                <input name="uid" type="hidden" value="<?php echo $_POST['uid'] ?>">
                            </form>
                    </div>
                    
            </div>
            <br><br>
            
            <div style="clear: both"></div>
            
            <?php $datosOrigen = datosUsuario($_SESSION['uid']); ?>
            
            <!-- VENTANAS MODALES -->
            <?php include 'denunciarPerfil.php'; ?>
            <?php include 'enviarMensaje.php'; ?>
            <?php include 'valorarUsuario.php'; ?>
            
            
            <script language="javascript">
                $(document).ready(function(){
                     $('#videobook').fancybox({
                        openEffect  : 'none',
                        closeEffect : 'none',
                        helpers : {
                                media : {}
                        }
                    });
                    $("#enviarMensaje").tooltip({ placement: 'left', html : true, trigger:'hover', title: 'Enviar Mensaje'});
                    $("#valorar").tooltip({ placement: 'left', html : true, trigger:'hover', title: 'Valorar Usuario'});
                    $("#formularioDenuncia").tooltip({ placement: 'left', html : true, trigger:'hover', title: 'Valorar Usuario'});

                });
            
            </script>
        </div>
        <?php include '../footer.php' ?>
    </body>
</html>